const BASE_URL = 'https://www.uinav.com'

function request(options) {
	return new Promise((reslove) => {
		uni.showLoading({
			title: '加载中...',
			mask: true
		})

		uni.request({
			url: BASE_URL + options.url,
			success: (res) => {
				let {
					message,
					meta
				} = res.data
				if (meta.status === 200) {
					reslove(message)
				}
			},
			complete: () => {
				uni.hideLoading()
			}
		})
		
	})

}

export default request